Search
woogc/ps/interfaces/sync_to_shop - WP Global Cart
17181
documentation-template-default,single,single-documentation,postid-17181,theme-awake,eltd-core-1.1,woocommerce-no-js,awake child-child-ver-1.0.0,awake-ver-1.0,eltd-smooth-scroll,eltd-smooth-page-transitions,eltd-mimic-ajax,eltd-grid-1200,eltd-blog-installed,eltd-default-style,eltd-fade-push-text-top,eltd-header-standard,eltd-sticky-header-on-scroll-down-up,eltd-default-mobile-header,eltd-sticky-up-mobile-header,eltd-menu-item-first-level-bg-color,eltd-dropdown-slide-from-top,eltd-,eltd-fullscreen-search eltd-search-fade,eltd-side-menu-slide-from-right,wpb-js-composer js-comp-ver-6.3.0,vc_responsive
 

woogc/ps/interfaces/sync_to_shop

WP Global Cart / woogc/ps/interfaces/sync_to_shop
Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInShare on TumblrPin on PinterestEmail this to someonePrint this page

woogc/ps/interfaces/sync_to_shop

Name: woogc/ps/interfaces/sync_to_shop
Type: Filter
Arguments: $status, $remote_blog_id, $post

The filter can be used to change the synchronization interface button status from active to inactive or vice versa.

For example, when creating a new product, the buttons will show up active as default:


    add_filter ( 'woogc/ps/interfaces/sync_to_shop',        'woogc_ps_interfaces_option_status', 10, 3 );   
    add_filter ( 'woogc/ps/interfaces/maintain_child',      'woogc_ps_interfaces_option_status', 10, 3 );
    add_filter ( 'woogc/ps/interfaces/maintain_categories', 'woogc_ps_interfaces_option_status', 10, 3 );
    add_filter ( 'woogc/ps/interfaces/maintain_stock',      'woogc_ps_interfaces_option_status', 10, 3 );
    function woogc_ps_interfaces_option_status( $status, $remote_blog_id, $post )
        {
            //if nnew product post, set to enabled
            if ( $post->post_status ==  'auto-draft' )
                $status   =   TRUE;
                   
            return $status;   
        }

The code should be placed inside a php file on wp-content/mu-plugins folder.

0
Would love your thoughts, please comment.x
()
x